From: Keir Fraser Date: Tue, 20 May 2008 13:50:45 +0000 (+0100) Subject: xend: Support HVM S3 resume. X-Git-Tag: archive/raspbian/4.8.0-1+rpi1~1^2~14210^2~12 X-Git-Url: https://dgit.raspbian.org/%22http:/www.example.com/cgi/%22https:/%22bookmarks://%22Dat/%22http:/www.example.com/cgi/%22https:/%22bookmarks:/%22Dat?a=commitdiff_plain;h=306921aa6fe884cd988244e8ad4644a1c76d8cea;p=xen.git xend: Support HVM S3 resume. Signed-off-by: Yu Ke Signed-off-by: Ke Liping Signed-off-by: Keir Fraser --- diff --git a/tools/python/xen/xend/XendConstants.py b/tools/python/xen/xend/XendConstants.py index 75f9d98c43..8b98286841 100644 --- a/tools/python/xen/xend/XendConstants.py +++ b/tools/python/xen/xend/XendConstants.py @@ -48,6 +48,7 @@ HVM_PARAM_VHPT_SIZE = 8 HVM_PARAM_BUFPIOREQ_PFN = 9 HVM_PARAM_TIMER_MODE = 10 HVM_PARAM_HPET_ENABLED = 11 +HVM_PARAM_ACPI_S_STATE = 14 restart_modes = [ "restart", @@ -102,11 +103,13 @@ LAST_SHUTDOWN_REASON = 'xend/last_shutdown_reason' TRIGGER_NMI = 0 TRIGGER_RESET = 1 TRIGGER_INIT = 2 +TRIGGER_S3RESUME = 3 TRIGGER_TYPE = { "nmi" : TRIGGER_NMI, "reset" : TRIGGER_RESET, - "init" : TRIGGER_INIT + "init" : TRIGGER_INIT, + "s3resume": TRIGGER_S3RESUME } # diff --git a/tools/python/xen/xend/XendDomain.py b/tools/python/xen/xend/XendDomain.py index 1d86f4160a..0089090364 100644 --- a/tools/python/xen/xend/XendDomain.py +++ b/tools/python/xen/xend/XendDomain.py @@ -1657,6 +1657,9 @@ class XendDomain: trigger = TRIGGER_TYPE[trigger_name.lower()] else: raise XendError("Invalid trigger: %s" % trigger_name) + if trigger == TRIGGER_S3RESUME: + xc.hvm_set_param(dominfo.getDomid(), HVM_PARAM_ACPI_S_STATE, 0) + return None try: return xc.domain_send_trigger(dominfo.getDomid(), trigger, diff --git a/tools/python/xen/xm/main.py b/tools/python/xen/xm/main.py index a7351dbd1a..01660ca297 100644 --- a/tools/python/xen/xm/main.py +++ b/tools/python/xen/xm/main.py @@ -143,7 +143,7 @@ SUBCOMMAND_HELP = { 'Get/set credit scheduler parameters.'), 'sysrq' : (' ', 'Send a sysrq to a domain.'), 'debug-keys' : ('', 'Send debug keys to Xen.'), - 'trigger' : (' []', + 'trigger' : (' []', 'Send a trigger to a domain.'), 'vcpu-list' : ('[Domain, ...]', 'List the VCPUs for all/some domains.'),